package com.demo.base.exception;

import com.demo.base.bean.OutputStatus;

/**
 * Created by ethan on 2017/1/14.
 */
public class FrameworkException extends RuntimeException {

    /**
     * 异常代码
     */
    private String code;

    public FrameworkException(OutputStatus status) {
        this(status.getCode(), status.getMessage());
    }

    public FrameworkException(OutputStatus status, String message) {
        this(status.getCode(), message);
    }

    public FrameworkException(OutputStatus status, Throwable cause) {
        this(status, status.getMessage(), cause);
    }

    public FrameworkException(OutputStatus status, String message, Throwable cause) {
        this(status.getCode(), message, cause);
    }

    public FrameworkException(String code, String message) {
        super(message);
        this.code = code;
    }

    public FrameworkException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public String getCode() {
        return code;
    }

}
